package com.ddwl.data.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.data.service.DataService;
import com.ddwl.schema.vo.base.RestVo;
import com.ddwl.schema.vo.data.DataTodayVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/8/8 16:41
 */
@Api(tags = "数据服务")
@Auth(product = {BaseEnum.ProductEnum.CONSOLE, BaseEnum.ProductEnum.API})
@RequestMapping
@RestController
public class DataController extends BaseController {

    @Autowired
    private DataService dataService;

    @ApiOperation("今日实时统计")
    @GetMapping("/today")
    public RestVo<DataTodayVo> today() {
        return RestVo.ok(dataService.today());
    }
}
